home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2006 May / PCWMAY06.iso / Software / Resources / PaperCut Quota 6.1 / pc-setup.exe / {app} / WebAdmin / ChargeRates.asp < prev    next >
Text File  |  2005-10-13  |  4KB  |  139 lines

  1. <%@ Language=VBScript %>
  2. <%' (c) Copyright 1999-2005 PaperCut Software Pty. Ltd. %>
  3. <!--#include file="includes/PCCommon.inc" -->
  4. <!--#include file="includes/header.inc" -->
  5.  
  6. <H1><%= GetText("ChargeRates")%></H1>
  7.  
  8.  
  9. <H2><%= GetText("PrinterCosts")%></H2>
  10.  
  11.  
  12. <table width="90%" align="center" class="webAdmin">
  13.     <tr>
  14.         <th><%= GetText("Printer") %></th>
  15.         <th><%= GetText("PageCost") %></th>
  16.         <th><%= GetText("GrayscaleDiscount") %></th>
  17.         <th><%= GetText("DuplexDiscount") %></th>
  18.         <th><%= GetText("Details") %></th>
  19.     </tr>
  20.  
  21. <%
  22. Dim objCharges
  23. Set objCharges = Server.CreateObject("PCWebAdmin.clsCharges")
  24. objCharges.TranslationExtraPerPage = GetText("ExtraPerPage")
  25. objCharges.TranslationLessPerPage = GetText("LessPerPage")
  26. objCharges.TranslationExtra = GetText("Extra")
  27. objCharges.TranslationLess = GetText("Less")
  28. objCharges.TranslationPerMetre2 = GetText("PerMetre2")
  29. objCharges.TranslationPerFoot2 = GetText("PerFoot2")
  30. objCharges.TranslationPerPage = GetText("PerPage")
  31.  
  32.  
  33. Function GetCostValue(objPrinter) 
  34.     If objPrinter.strAreaCost <> "" Then
  35.         GetCostValue = objPrinter.strAreaCost
  36.     ElseIf objPrinter.strPageSizeDefaultColor <> "" Then
  37.         GetCostValue = GetText("Advanced")
  38.     Else
  39.         GetCostValue = objPrinter.strCost
  40.     End If
  41. End Function
  42.  
  43. Function GetOtherCostValue(objPrinter)
  44.     If objPrinter.strPageSizeDefaultColor <> "" then
  45.         GetOtherCostValue = GetPageSizeOtherCostValue(objPrinter)
  46.     ElseIf objPrinter.strVeryLargePageSurplus <> "" Then
  47.         GetOtherCostValue = "<table class=""printOtherCosts""><th>" & GetText("LargePaper") & ":</th><td>" & objPrinter.strLargePageSurplus & "</td></tr>" _
  48.                                 & "<tr><th>" & GetText("VeryLargePaper") & ":</th><td>" & objPrinter.strVeryLargePageSurplus _
  49.                                 & "</td></tr></table>"
  50.         
  51.     end if
  52.     
  53. End Function 
  54.  
  55. Function GetPageSizeOtherCostValue(objPrinter)
  56.     Dim s
  57.     
  58.     s = s & "<table class=""printOtherCosts"">"
  59.     s = s & "<tr><th>" & GetText("Size") & "</th><th>" & GetText("GrayscaleCost") & "</th><th>" & GetText("ColorCost") & "</th></tr>"
  60.     
  61.     Dim strPageSize 
  62.     For Each strPageSize in objPrinter.colPageSizes
  63.         s = s & "<tr><td>" & strPageSize & "</td><td>" & objPrinter.dctPageSizeGrayscaleCosts(strPageSize) & "</td><td>" & objPrinter.dctPageSizeColorCosts(strPageSize) & "</td></tr>"
  64.     Next
  65.     s = s & "</table><br/>"
  66.     
  67.     s = s & "<table class=""printOtherCosts"">"
  68.     s = s & "<tr><th>" & GetText("DefaultGrayscaleCost") & ":</th><td>" & objPrinter.strPageSizeDefaultGrayscale & "</td></tr>"
  69.     s = s & "<tr><th>" & GetText("DefaultColorCost") & ":</th><td>" & objPrinter.strPageSizeDefaultColor & "</td></tr>"
  70.     s = s & "</table>"
  71.     
  72.     GetPageSizeOtherCostValue = s
  73.  
  74. End Function
  75.  
  76.  
  77. Dim colPrinters
  78. Dim objPrinter
  79. Dim lngRow
  80.  
  81. Set colPrinters = objCharges.GetPrinters()
  82.  
  83. lngRow = 0
  84. For Each objPrinter in colPrinters
  85. %>
  86.     <tr class="<%=RowClassHelper(lngRow)%>">
  87.         <td><%=objPrinter.strPrinterName%></td>
  88.         <td><%=GetCostValue(objPrinter)%></td>
  89.         <td><%=objPrinter.strGrayscaleDiscount%></td>
  90.         <td><%=objPrinter.strDuplexDiscount%></td>
  91.         <td><%=GetOtherCostValue(objPrinter)%></td>
  92.     </tr>
  93. <%
  94.     lngRow = lngRow + 1
  95. Next
  96.  
  97. Set colPrinters = Nothing
  98. Set objPrinter = Nothing
  99.  
  100. %>
  101. </table>
  102.  
  103.  
  104. <br/>
  105. <br/>
  106. <% If gblnHasNetCharging Then %>
  107.  
  108. <h2><%=GetText("NetCosts")%></h2>
  109.  
  110. <table style="margin-left: 40px;" cellpadding="4px">
  111.     <tr>
  112.         <th><%=GetText("NetChargingType")%>: </th>
  113.         <td><%
  114.             If objCharges.NetChargeMethod = "MB" Then
  115.                 Response.Write GetText("DataUsed")
  116.             Else
  117.                 Response.Write GetText("TimeUsed")
  118.             End If
  119.             %> 
  120.         </td>
  121.     </tr>
  122.     <tr>
  123.         <th><%=GetText("Cost")%>: </th>
  124.         <td><%
  125.             If objCharges.NetChargeMethod = "MB" Then
  126.                 Response.Write GetTextReplace("DataCost", Array(FormatCredit(objCharges.NetCostPerMB)))
  127.             Else
  128.                 Response.Write GetTextReplace("TimeCost", Array(FormatCredit(objCharges.NetCostPerPeriod), objCharges.NetPeriodMins))
  129.             End If
  130.             %> 
  131.         </td>
  132.     </tr>
  133. </table>
  134.  
  135. <% End If %>
  136.  
  137.  
  138.  
  139. <!--#include file="includes/footer.inc" -->